package me.raih.controller.admin.common;

import me.raih.pojo.po.Admin;
import me.raih.service.AdminService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.servlet.http.HttpSession;

/**
 * @Author Raih
 * @Time 2020/11/22  11:29
 *
 * 后台首页
 */
@Controller
@RequestMapping(value = "/admin")
public class IndexController {

    @Autowired
    AdminService adminService;


    @RequestMapping(value = "/index")
    public String toIndex(){

        return "admin/index";

    }

    @ResponseBody
    @RequestMapping(value = "/findUser",method = RequestMethod.PUT)
    public Admin toReady(HttpSession session){

        return (Admin)session.getAttribute("LOGIN_SESSION_FLAG");

    }

}
